<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  

  <script src="./renderer.js"></script>
  <script>
    // 1、通过h函数创建VNode
    const vnode=h('div',{class:'lky',id:'lky'},[
      h('h2',null,'当前计数：100'),
      h('button',{onclick:function(){console.log('button')}},'+1')
    ])
    // 2、通过mount函数，挂载到#app上
    mount(vnode,document.querySelector('#app'))

    const vnode2=h('div',{class:'newlky',ld:'lky'},[
      h('h2',null,'children数组patch'),
      h('button',{onclick:function(){console.log('button')}},'-1'),
      h('h3',{onclick:function(){console.log('h3')}},'我是new新增的'),

    ])
    patch(vnode,vnode2)
  </script>
</body>
</html>